home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Contrib / STk-wtour / lessons / tkwait.stk < prev   
Encoding:
Text File  |  1995-12-13  |  671 b   |  31 lines

  1. ;; tkwait, used for waiting for dialog input
  2.  
  3. (define tkwait-label #f)
  4.  
  5. (define make-panel 
  6.   (lambda ()
  7.     (toplevel '.top)
  8.     (button '.top.ok 
  9.         :text "OK" 
  10.         :command (lambda ()
  11.                (set! tkwait-label "ok")
  12.                (destroy .top)))
  13.     (button '.top.cancel 
  14.         :text "Cancel" 
  15.         :command (lambda ()
  16.                (set! tkwait-label "cancel")
  17.                (destroy .top)))
  18.     
  19.     (pack .top.ok .top.cancel :side "left" :padx "10" :pady "10")
  20.     (grab 'set .top)
  21.     (tkwait 'window .top)
  22.     tkwait-label))
  23.  
  24. (button '.b 
  25.     :text "Try pressing me!" 
  26.     :command  (lambda ()
  27.             (let ([x (make-panel)])
  28.               (format #t "You pressed ~a\n" x))))
  29.  
  30. (pack .b)
  31.